import request from '@/utils/request'

export function getOrderByPage(data) {
  return request({
    url: '/order',
    params: { ...data }
  })
}

export function getOrderById(id) {
  return request({
    url: `/order/${id}`,
  })
}

export function addOrder(data) {
  return request({
    url: '/order',
    method: 'post',
    data: data
  })
}

export function updateOrderById(data) {
  return request({
    url: `/order`,
    method: 'put',
    data: data
  })
}

export function deleteOrder(id) {
  return request({
    url: `/order/${id}`,
    method: 'delete',
  })
}

export function batchDeleteOrder(idList) {
  return request({
    url: `/order/batchDelete`,
    method: 'post',
    data: idList
  })
}
